package edu.xmut.yuepai.sys.controller;

import edu.xmut.yuepai.common.result.R;
import edu.xmut.yuepai.model.entity.SysTags;
import edu.xmut.yuepai.sys.service.SysTagsService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RequestMapping("/sys-tag")
@RestController
public class SysTagController {
    @Resource
    private SysTagsService sysTagsService;
    @GetMapping("/search/{content}")
    public R searchOrAddTag(@PathVariable String content) {
        List<SysTags> sysTags = sysTagsService.searchAndAdd(content);
        return R.ok(sysTags);
    }
}
